<?php
session_start();

$cant_fbinvitation = "A&uacute;n no tienes amigos.";
$contador = 1;

if (is_array($_SESSION["g2uFriendList"]) && !empty($_SESSION["g2uFriendList"])) {
    $cant_fbinvitation = count($_SESSION["g2uFriendList"]);
    ?>
    <table width='100%' cellpadding = '3px' cellspacing="0">
            <tr>
    <?
    foreach ($_SESSION["g2uFriendList"] as $key => $value) {
?>
        
                <td width="50px">
                    <img src='<?=$value["upic"]?>' class="profile-img" />
                </td>
                <td width="35%">
                    <a href="@/<?=$value["user_sys_name"];?>"><b style="cursor: pointer;" ><?=$value['usuario']?></b></a>
                </td>
<?php
                if($cant_fbinvitation==1){
                ?>
                <td width="50px">
                    
                </td>
                <td width="35%">
                </td>
                <?
                }
                if($contador == 3){
                    ?>
                    </tr>
                    <tr>
                    <?
                    $contador = 0;
                }
                $contador++;
    }
    ?>
         </tr>
    </table>       
    <?php
} else {
    echo $cant_fbinvitation;
}
?>